import axios from "axios"
import nprogress from "nprogress"
import "nprogress/nprogress.css"
const servce = axios.create({
    baseURL: 'http://ludir.cn:8888/api/private/v1/'
});

  servce.interceptors.request.use(function (config) {
    config.headers.Authorization = sessionStorage.getItem("token")
    nprogress.start();
    return config;
  }, function (error) {
    nprogress.done()
    return Promise.reject(error);
  });

  servce.interceptors.response.use(function (response) {
    nprogress.done()
    return response.data;
  }, function (error) {
    nprogress.done()
    return Promise.reject(error);
  });

export default servce